<%-- 
    Document   : shipmentOrder
    Created on : May 17, 2013, 6:01:01 PM
    Author     : Nabytovych Andrey
--%>
<%@page import="com.charlie.db.ShipmentOrderData"%>
<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.util.List"%>

<%@include file="../header.jsp" %>

<div class="left_side">
    <jsp:include page="/blocks/conditionalLeftBar.jsp" />
</div>

<div class="right_side">
    <h2 class="content_title">Select the order you want to serve</h2>
    <div class="white_block">
<%
    List<ShipmentOrderData> orderList = (List<ShipmentOrderData>) request.getAttribute("shipmentOrderList");
    if (orderList != null) {
        SimpleDateFormat format = new SimpleDateFormat("dd.MM.yyyy");
%>
        <table class="typycal_table">
            <thead>
                <tr class="underLinedRow2"> 
                    <th> id </th>
                    <th> user e-mail </th>
                    <th> creation date </th>
                    <th> location </th>
                    <th> cost </th>
                </tr>
            </thead>
            <tbody>
<%
        for (ShipmentOrderData item : orderList) {
%>
                <tr class="reportFixCell">
                    <td class="rightAligment">
<%=
            item.getSoId()
%>
                    </td>
                    <td>
                        <div class="reportFixEmailCell">
<%
            if (item.getEmail()!= null) {
                out.println(item.getEmail());
            } else {
                out.println(" no info ");
            }
%>
                        </div>
                    </td>
                    <td class="rightAligment">
<%=
            format.format(item.getCreationDate())
%>
                    </td>
                    <td>
                        <div class="reportFixLocationCell">
<%=
            item.getLocation()
%>
                        </div>
                    </td> 
                    <td class="rightAligment">
<%=
            item.getCost().toString() + "$"
%>
                    </td>
                </tr>
<%
        }
%>
            </tbody>
        </table>
<%
    } else {
        out.print("<h1>No orders</h1>");
    }
%>
        <form method="POST" style="float: right;">
            <input class="btn" value="Export" type="submit"> 
        </form>
        <br>
    </div>

    <jsp:include page="/blocks/pages.jsp">
        <jsp:param name="path" value="warehouse/shipmentOrder" />
    </jsp:include>
</div>
    
